package com.ai.service.made.impl;

import com.ai.common.CommonResponse;
import com.ai.entity.exam.ExamRecordPO;
import com.ai.entity.exam.ExamRecordPage;
import com.ai.entity.exam.ExamRecordVO;
import com.ai.mapper.made.ExamRecordMapper;
import com.ai.service.made.ExamRecordService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author：xiaosheng
 * @Date：2024-07-02 15:44
 */
@Service
public class ExamRecordServiceImpl extends ServiceImpl<ExamRecordMapper, ExamRecordPO> implements ExamRecordService {

    @Autowired
    private ExamRecordMapper examRecordMapper;

    @Override
    public CommonResponse insert(ExamRecordPO examRecordPO) {
        return CommonResponse.ok(examRecordMapper.insert(examRecordPO));
    }

    @Override
    public IPage<ExamRecordVO> selectPage(ExamRecordPage examRecordPage, QueryWrapper<ExamRecordPO> queryWrapper) {

        IPage<ExamRecordVO> iPage = examRecordMapper.selectByPage(examRecordPage, queryWrapper);

        return iPage;
    }
}
